import { SET_LIST, ListAction } from "./listAction";

interface List {
  list: ListItemState[];
}

export interface ListItemState {
  title: string;
  id: string;
  type: string;
  tel: string;
  address: string;
	createDate: string
}

const initState: List = {
  list: [],
};

export default (state = initState, action: ListAction) => {
  switch (action.type) {
    case SET_LIST:
      return {
        ...state,
        list: action.payload,
      };
    default:
      return state;
  }
};
